<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>V-on Test</title>
</head>
<body>
    <div id="app">
        点击次数：{{ counter }}
        <button @click="handleAdd()">+ 1</button>
        <button @click="handleAdd(10)">+ 10</button>
        <br>
        <div id="app1">
            <a href="http://www.apple.com" @click="handleClick('禁止打开', $event)">打开链接</a>
        </div>
    </div>
    <script src="https://unpkg.com/vue/dist/vue.min.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                counter: 0
            },
            methods: {
                handleAdd: function (count) {
                    count = count || 1;
                    this.counter += count;
                }
            }
        });
        var app1 = new Vue({
            el: '#app1',
            methods: {
                handleClick: function (message, event) {
                    event.preventDefault();
                    window.alert(message);
                }
            }
        })
    </script>
</body>
</html>